﻿using Roslyn.Compilers.CSharp;

namespace BITS.PreCompiler.CSharp.Syntax
{
    public abstract partial class BaseType<TSelf, TSyntaxNode>
        where TSelf : BaseType<TSelf, TSyntaxNode>
        where TSyntaxNode : BaseTypeDeclarationSyntax
    {
        # region • Ctor's •

        /// <summary>
        /// Initializes a new instance of the <see cref="BaseType&lt;TSelf, TSyntaxNode&gt;"/> class.
        /// </summary>
        /// <param name="syntax">The type declaration syntax.</param>
        /// <param name="parent">The parent.</param>
        protected BaseType(TSyntaxNode syntax, IBaseSyntaxNode parent = null)
            : this(syntax.Kind, parent)
        {
            this.ExtractAttributes(syntax.Attributes);

            this.Identifier = syntax.Identifier;
        }

        # endregion Ctor's
    }
}
